Qt自定义控件之颜色对话框QColorDialog/Qt Color Widgets |
您所在的位置:网站首页 › color widgets怎么取消收费 › Qt自定义控件之颜色对话框QColorDialog/Qt Color Widgets |
1、官方自带
Qt官方自带的QColorDialog类提供了一个指定颜色的对话框部件。 #include QColor i = QColorDialog::getColor(Qt::red, this, tr("颜色对话框"), QColorDialog::ShowAlphaChannel); 但是好多开源项目都使用了自定义控件Qt Color Widgets。 Glax / Qt-Color-Widgets · GitLab C++使用方法: 1.pro文件 LIBS += -L$${DESTDIR} #lib path LIBS += "QtColorWidgets-Qt52.lib" INCLUDEPATH += ../color_widgets/include/ INCLUDEPATH += ../color_widgets/include/QtColorWidgets/ 2.cpp源文件 #include "color_dialog.hpp" void Designer::on_actionColor_triggered() { color_widgets::ColorDialog dlg; connect(&dlg, &color_widgets::ColorDialog::colorSelected, this, &Designer::color_changed); dlg.exec(); } void Designer::color_changed(QColor color) { int r, g, b, a; color.getRgb(&r, &g, &b, &a); color.getHsv(&r, &g, &b, &a); }https://github.com/pencil2d/pencil https://github.com/douzhongqiang/EasyCanvas https://github.com/caryoscelus/rainynite-studio https://github.com/caryoscelus/Qt-Color-Widgets https://github.com/abaoa/GradientCreator ------ https://github.com/frankosterfeld/qtkeychain 独立于平台的Qt API,用于安全存储密码。 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |